﻿using System.Reflection;

namespace Project.T4Code
{
    public class SqlFactory
    {
        public static BaseSqlBuilder GetSqlBuilder(int action, string tableName, PropertyInfo[] properties, string provider = "System.Data.OracleClient")
        {
            BaseSqlBuilder sqlBuilder = null;
            switch (action)
            {
                case 1: sqlBuilder = new InsertSqlBuilder(tableName, properties, provider); break;
                case 2: sqlBuilder = new EditSqlBuilder(tableName, properties, provider); break;
                case 3: sqlBuilder = new DeleteSqlBuilder(tableName, properties, provider); break;
                case 4: sqlBuilder = new QuerySqlBuilder(tableName, properties, provider); break;
                case 5: sqlBuilder = new QuerySqlPagerBuilder(tableName, properties, provider); break;
            }
            return sqlBuilder;
        }
    }
}